//
// Created by wze-zero on 2024/7/10 010.
//
#include <iostream>

using namespace std;

int main() {
    int arr[6], min, max;
    int length = sizeof(arr) / sizeof(int);
    for (int i = 0; i < length; ++i) {
        cin >> arr[i];
    }
    min = arr[0];
    max = arr[0];
    for (int i = 0; i < length; ++i) {
        max = arr[i] > max ? arr[i] : max;
        min = arr[i] < min ? arr[i] : min;
    }
    cout << min << " " << max << endl;
    return 0;
}